public class Learn_1 {
    public static void main(String[] args) {
        //byte
        System.out.println("字节型byte");
        System.out.println(Byte.MAX_VALUE);
        System.out.println(Byte.MIN_VALUE);
        System.out.println("----------------------------------------------------");
        //short
        System.out.println("短整型short");
        System.out.println(Short.MAX_VALUE);
        System.out.println(Short.MIN_VALUE);
        System.out.println("----------------------------------------------------");
        //int
        System.out.println("整形int");
        System.out.println(Integer.MAX_VALUE);
        System.out.println(Integer.MIN_VALUE);
        System.out.println("----------------------------------------------------");
        //long
        System.out.println("长整形long");
        System.out.println(Long.MAX_VALUE);
        System.out.println(Long.MIN_VALUE);
        System.out.println("----------------------------------------------------");
        //隐式转换，低于两个字节的变量参与运算时将转为四个字节
        byte a = 10;
        byte b = 20;
        int c = a + b;
        System.out.println(c);
        System.out.println("----------------------------------------------------");
        //字符串相加为字符串拼接
        String str1 = "hello";
        String str2 = "world";
        System.out.println(str1+str2);
        System.out.println("----------------------------------------------------");
        int d = 10;
        int e = 20;
        System.out.println("num = "+d+e);//先碰到字符串'+'为拼接
        System.out.println(d+e+"=num");// 先碰到数据运算'+'为变量运算
    }
}
